package exam.test2;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: hzniufanglong
 * Date: 2020-06-20
 * Time: 12:05
 */


class Car {
	private String name;

	public Car(String name) {
		this.name = name;
	}

	public String getName() {
		return name;
	}
}

class SportsCar extends Car {
	public SportsCar() {
		super("Ferrari 812");
	}
}

class EconomyCar extends Car {
	public EconomyCar() {
		super("Toyota Corolla");
	}
}


public class FindError {

	public static void main(String[] params) {

		EconomyCar e = new EconomyCar();
		System.out.println(e.getName());

		Car c = new SportsCar();
		System.out.println(c.getName());
	}
}
